<template>
  <div id="root">
    <button @click="getStudent">获取学生信息</button>
    <button @click="getCart">获取汽车信息</button>
  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "App",
  methods: {
    getStudent() {
      axios.get("http://localhost:8080/api/student").then(
        (response) => {
          console.log(response.data);
        },
        (error) => {
          console.log(error.message);
        }
      );
    },
    getCart() {
      axios.get("http://localhost:8080/foo/cart").then(
        (response) => {
          console.log(response.data);
        },
        (error) => {
          console.log(error.message);
        }
      );
    },
  },
};
</script>
